GTK_DEBUG_BUILDER = 1 << 11,
GTK_DEBUG_SIZE_REQUEST = 1 << 12,
GTK_DEBUG_NO_CSS_CACHE = 1 << 13,
- GTK_DEBUG_BASELINES = 1 << 14
+ GTK_DEBUG_BASELINES = 1 << 14,
+ GTK_DEBUG_PIXEL_CACHE = 1 << 15
} GtkDebugFlag;
#ifdef G_ENABLE_DEBUG
{"builder", GTK_DEBUG_BUILDER},
{"size-request", GTK_DEBUG_SIZE_REQUEST},
{"no-css-cache", GTK_DEBUG_NO_CSS_CACHE},
- {"baselines", GTK_DEBUG_BASELINES}
+ {"baselines", GTK_DEBUG_BASELINES},
+ {"pixel-cache", GTK_DEBUG_PIXEL_CACHE}
};
#endif /* G_ENABLE_DEBUG */
#include "config.h"
+#include "gtkdebug.h"
#include "gtkpixelcacheprivate.h"
/* The extra size of the offscreen surface we allocate
cairo_set_operator (backing_cr, CAIRO_OPERATOR_OVER);
+ cairo_save (backing_cr);
draw (backing_cr, user_data);
+ cairo_restore (backing_cr);
+
+#ifdef G_ENABLE_DEBUG
+ if (gtk_get_debug_flags () & GTK_DEBUG_PIXEL_CACHE)
+ {
+ GdkRGBA colors[] = {
+ { 1, 0, 0, 0.08},
+ { 0, 1, 0, 0.08},
+ { 0, 0, 1, 0.08},
+ { 1, 0, 1, 0.08},
+ { 1, 1, 0, 0.08},
+ { 0, 1, 1, 0.08},
+ };
+ static int current_color = 0;
+
+ gdk_cairo_set_source_rgba (backing_cr, &colors[(current_color++) % G_N_ELEMENTS (colors)]);
+ cairo_paint (backing_cr);
+ }
+#endif
cairo_destroy (backing_cr);
}